import groupApi from '@/api/setting/group'
import { getToken } from '@/utils/auth'

let result = []
function getGroupOption() {
  result = groupApi.getList().then(res => {
    return res.rows.map(item => ({
      label: item.groupName,
      value: item.groupId
    }))
  })
}
if (getToken()) {
  getGroupOption()
}


export default {
  // 获取分组select数组
  groupDictOption() {
    return result
  },
  smartLockDictOption() {
    return [{
      label: '全部状态',
      value: ''
    }, {
      label: '房间锁',
      value: '2'
    }, {
      label: '公区锁',
      value: '3'
    }, {
      label: '低电量锁',
      value: '1'
    }, {
      label: '未绑定房间',
      value: '4'
    }]
  }
}